import request from "@/utils/request";

export function addDocumentVideo(documentVideo) {
    return request({
        url: '/documentVideo/addDocumentVideo',
        method: 'post',
        data:documentVideo
    })
}

export function deleteDocumentVideo(ids) {
    return request({
        url: '/documentVideo/deleteDocumentVideo',
        method: 'delete',
        data:ids
    })
}

export function changeDocumentVideo(documentVideo) {
    return request({
        url: '/documentVideo/updateDocumentVideo',
        method: 'post',
        data:documentVideo
    })
}

export function getAllDocumentVideo(documentVideo,page,pageSize) {
    return request({
        url: '/documentVideo/getAllDocumentVideo?'+'page='+page+'&pageSize='+pageSize,
        method: 'post',
        data:documentVideo
    })
}
export function getDocumentVideoList() {
    return request({
        url: '/documentVideo/getDocumentVideoList',
        method: 'get',
    })
}

export function getReviewDocumentVideoList(searchChoose,page,pageSize) {
    return request({
        url: '/documentVideo/getReviewDocumentVideoList?searchChoose='+searchChoose+'&page='+page+'&pageSize='+pageSize,
        method: 'get',
    })
}






export function getDocumentVideo(trainingPlanId, searchChoose) {
    let choose = 1;
    if (searchChoose) {
        choose = 0
    }
    return request({
        url: '/documentVideo/getDocumentVideo?trainingPlanId=' + trainingPlanId + "&choose=" + choose,
        method: 'get',
    })
}

export function chooseDocumentVideo(ids, trainingPlanId) {
    return request({
        url: '/documentVideo/chooseDocumentVideos?trainingPlanId=' + trainingPlanId,
        method: 'post',
        data:ids
    })
}
export function unchooseDocumentVideo(ids, trainingPlanId) {
    return request({
        url: '/documentVideo/unchooseDocumentVideos?trainingPlanId=' + trainingPlanId,
        method: 'post',
        data:ids
    })
}
